package com.primeton.eos.oss.model.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.eos.system.utility.PageResultList;
import com.primeton.components.rest.annotation.MultiRequestBody;
import com.primeton.eos.oss.model.newdataset.CrecAccountHis;
import com.primeton.eos.oss.model.service.CrecAccountHisService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

@Api(tags = "CrecAccountHis管理")
@RestController
@RequestMapping(value = "/api/oss/model/crecaccounthiss", consumes = { MediaType.APPLICATION_JSON_UTF8_VALUE }, produces = {
        MediaType.APPLICATION_JSON_UTF8_VALUE })
public class CrecAccountHisController {

    @Autowired
    private CrecAccountHisService crecAccountHisService;

    @ApiOperation("新增CrecAccountHis")
    @PostMapping
    public void createCrecAccountHis(@ApiParam("CrecAccountHis信息") @MultiRequestBody CrecAccountHis crecAccountHis) {
        crecAccountHisService.createCrecAccountHis(crecAccountHis);
    }
    
    @ApiOperation("修改CrecAccountHis")
    @PutMapping
    public void modifyCrecAccountHis(@ApiParam("CrecAccountHis信息") @MultiRequestBody CrecAccountHis crecAccountHis) {
        crecAccountHisService.modifyCrecAccountHis(crecAccountHis);
    }
    
    @ApiOperation("删除CrecAccountHis")
    @DeleteMapping
    public void removeCrecAccountHis(@ApiParam("CrecAccountHis信息") @MultiRequestBody CrecAccountHis[] crecAccountHis) {
        crecAccountHisService.removeCrecAccountHis(crecAccountHis);
    }
    
    @ApiOperation("获取CrecAccountHis")
    @GetMapping("/{id}")
    public CrecAccountHis getCrecAccountHisById(@ApiParam("唯一标识") @PathVariable(name = "id") String id) {
        return crecAccountHisService.getCrecAccountHisById(id);
    }
    @ApiOperation("根据条件查询CrecAccountHis")
    @GetMapping(consumes = MediaType.ALL_VALUE)
    public PageResultList<CrecAccountHis> queryCrecAccountHissByCriteria(
		    @ApiParam("密码") @RequestParam(name = "password", required = false) String password,
            @ApiParam("每页条数") @RequestParam(name = "pageSize", required = false) int pageSize,
            @ApiParam("当前页数") @RequestParam(name = "pageIndex", required = false) int pageIndex) {
        return crecAccountHisService.queryCrecAccountHissWithPage(password,  pageSize, pageIndex);
    }
}









